<?php
/*
Primary Author: Derek Shue
Secondary: Alex Arey
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Organization Profile Form is used by Community Partners to add/edit their viewable 
Organization Profile.
*/
class Application_Form_OrganizationProfile extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
        
		$nameLenValid = new Zend_Validate_StringLength(array('max' => 30));
		$shortTextLenValid = new Zend_Validate_StringLength(array('max'=>8));
		$medTextLenValid = new Zend_Validate_StringLength(array('max' => 60));
		$longTextLenValid = new Zend_Validate_StringLength(array('max' => 120));
		$veryLongTextLenValid = new Zend_Validate_StringLength(array('max' => 1000));
		$phonevalid = new Zend_Validate_Regex(array('pattern' => '/^\(\d\d\d\) ?\d\d\d-\d\d\d\d$/'));
		
	$this->addElement('text','NAME',array(
	    'label' => 'Name:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($medTextLenValid),
	    'required' => True,
	    )
	);		
		
	$this->addElement('textarea','DESCRIPTION',array(
	    'label' => 'Description:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($veryLongTextLenValid),
	    'required' => True,
	    )
	);			
		
	$this->addElement('textarea','MISSION',array(
	    'label' => 'Mission:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($veryLongTextLenValid),
	    'required' => True,
	    )
	);
	
		$this->addElement('text','WEBSITE',array(
	    'label' => 'Website: Include \'http://\'',
	    'filters' => array('StringTrim'),
		'required' => True,
	    'validators'=>array($medTextLenValid),
	    )
	);
	
	$this->addElement('text','PHONE',array(
	    'label' => 'Phone: (Format: (###) ###-####)',
	    'filters' => array('StringTrim'),
	    'validators'=>array($phonevalid),
	    'required' => True,
	    )
	);
	
	$this->addElement('text','OTHERPHONE',array(
	    'label' => 'Other Phone:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($phonevalid),
	    )
	);
	
	$this->addElement('text','EXTENSION',array(
	    'label' => 'Extension:',
	    'filters' => array('StringTrim'),
	    'validators' => array('Digits',$shortTextLenValid),
	    )
	);
	
	$this->addElement('text','FAX',array(
	    'label' => 'Fax:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($phonevalid),
	    )
	);
	
	$this->addElement('text','ADDRESS1',array(
	    'label' => 'Address Line 1:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($longTextLenValid),
	    'required' => True,
	    )
	);
	
	$this->addElement('text','ADDRESS2',array(
	    'label' => 'Address Line 2:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($longTextLenValid),
	    )
	);
	
	$this->addElement('text','CITY',array(
	    'label' => 'City:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($nameLenValid),
	    'required' => True,
	    )
	);
	
	$this->addElement('text','COUNTY',array(
	    'label' => 'County:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($medTextLenValid),
	    'required' => True,
	    )
	);
				
	$this->addElement('text','STATE',array(
	    'label' => 'State:',
	    'filters' => array('StringTrim'),
	    'validators'=>array($nameLenValid),
	    'required' => True,
	    )
	);
	
	$this->addElement('text','ZIP',array(
	    'label' => 'Zip:',
	    'filters' => array('StringTrim'),
	    'validators' => array('Digits',$shortTextLenValid),
	    'required' => True,
	    )
	);
	
	//$this->addElement('radio','TRANSPORT',array(
	//    'label' => 'Transportation Required:',
	//    'filters' => array('StringTrim'),
	//    'multioptions' => array('y'=>'Yes','n'=>'No'), 
	// 	'required' => true,
	//    )
	//);
		
	$this->addElement('submit','submit',array(
	    'label' => 'Submit Request')
	);
	
	
	}
	
	
	/*
STATE	VARCHAR2
ZIP	VARCHAR2
PHONE	VARCHAR2/
EXTENSION	VARCHAR2
FAX	VARCHAR2
OTHERPHONE	VARCHAR2/
PRIMARYCONTACT	NUMBER/
WEBSITE	VARCHAR2/
MISSION	VARCHAR2/
DESCRIPTION	VARCHAR2/
TRANSPORT	VARCHAR2
ID	NUMBER/
NAME	VARCHAR2/
ADDRESS1	VARCHAR2
ADDRESS2	VARCHAR2
CITY	VARCHAR2
COUNTY	VARCHAR2/*
*/

}

